/****

    activequant - activestocks.eu

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

	
	contact  : contact@activestocks.eu
    homepage : http://www.activestocks.eu

 ****/
package org.activequant.calendar;

import org.activequant.core.types.TimeStamp;

/**
 * An interface to a calendar entry.<br/>
 * A calendar entry will typically not have a time zone. The calendar that holds the entry will have a time zone.<br/>
 * An interface. Defines the following methods:
 * <ul>
 * <li>long getStartOfEntryAsMillis()</li>
 * <li>long getEndOfEntryAsMillis()</li>
 * <li>boolean isDuring(final TimeStamp now)</li>
 * </ul>
 * <b>History:</b><br>
 * - [May 30, 2008] Created (mark)<br>
 * 
 * @author mark
 */
public interface ICalendarEntry {
	/**
	 * Get the time in milliseconds of the start of the calendar entry.
	 * 
	 * @return the start time for this calendar entry in milliseconds since the Epoch, GMT time.
	 */
	long getStartOfEntryAsMillis();

	/**
	 * Get the time in milliseconds of the end of the calendar entry.
	 * 
	 * @return the end time for this calendar entry in milliseconds since the Epoch, GMT time.
	 */
	long getEndOfEntryAsMillis();

	/**
	 * Check if a time stamp coincides with the calendar entry. Whether or not the time part is included in the check is
	 * determined by the implementation.
	 * 
	 * @param now
	 *            The time stamp to check.
	 * 
	 * @return true if the time stamp coincides with the calendar entry, otherwise false.
	 */
	boolean isDuring(final TimeStamp now);
}
